<div class="newsletterWidget radius">
  
  <?php if($thickbox) { ?>
	<h2 class="thickboxNewsletter"><a href="#frm_subscribe" title="Newsletter Subscribe" class="fancybox_sub"> <?php echo($text_subscribe); ?></a></h2>
  <?php } ?>
  
  <?php 
  if($thickbox) { ?> 
  <div id="frm_subscribe_hidden" style="display:none;"> 
  <?php } ?> 
      <div id="frm_subscribe">
          <form name="subscribe" id="subscribe"  class="form-inline" >
            <!--email-->
            <input type="text" class="newsMail" placeholder="<?php echo $text_email_subscribe; ?>" name="subscribe_email" id="subscribe_email">
            <!--name-->
            <input type="text" class="newsName" placeholder="<?php echo $text_name_subscribe; ?>" name="subscribe_name" id="subscribe_name">
            <?php for($ns=1;$ns<=$option_fields;$ns++) {
             $ns_var= "option_fields".$ns;
            ?>
            <?php if($$ns_var!=""){
                 
                 echo('<input placeholder="'.$$ns_var.'" class="newsName" type="text" value="" name="option'.$ns.'" id="option'.$ns.'">');
             } ?>
           <?php }?>
           <!--subscribe-->
           <a class="newsBtn radius " onclick="email_subscribe()"><?php echo $entry_button; ?></a>
           <!--unsubscribe-->
           <?php if($option_unsubscribe) { ?>
           <a class="newsBtn radius" onclick="email_unsubscribe()"><?php echo $entry_unbutton; ?></a>
           <?php } ?> 
           <div id="subscribe_result"></div>
          </form>
      </div><!-- frm_subscribe -->
  <?php if($thickbox) { ?> 
  </div> 
  <?php } ?>
 

<script language="javascript">
	<?php 
  		if(!$thickbox) { 
	?>	
function email_subscribe(){
	$.ajax({
			type: 'post',
			url: 'index.php?route=module/newslettersubscribe/subscribe',
			dataType: 'html',
            data:$("#subscribe").serialize(),
			success: function (html) {
				eval(html);
			}}); 
}
function email_unsubscribe(){
	$.ajax({
			type: 'post',
			url: 'index.php?route=module/newslettersubscribe/unsubscribe',
			dataType: 'html',
            data:$("#subscribe").serialize(),
			success: function (html) {
				eval(html);
			}}); 
}
   <?php }else{ ?>
function email_subscribe(){
	$.ajax({
			type: 'post',
			url: 'index.php?route=module/newslettersubscribe/subscribe',
			dataType: 'html',
            data:$("#subscribe").serialize(),
			success: function (html) {
				eval(html);
			}}); 
}
function email_unsubscribe(){
	$.ajax({
			type: 'post',
			url: 'index.php?route=module/newslettersubscribe/unsubscribe',
			dataType: 'html',
            data:$("#subscribe").serialize(),
			success: function (html) {
				eval(html);
			}}); 
}
   <?php } ?>

</script>
</div>
